import Vue from "vue";
import VueRouter from "vue-router";
import AdminsSystem from "../views/adminsSystem/AdminsSystem.vue";
import SalesMenSystem from "../views/salesMenSystem/SalesMenSystem.vue";
import AdminsLogin from "../views/Login/adminsLogin/index.vue";
import SalesMenLogin from "../views/Login/salesMenLogin/index.vue";
import Claims from "../components/claims/claimsList.vue";

Vue.use(VueRouter);

const routes = [
	{
		path: "/",
		redirect: "/adminsLogin",
	},
	{
		path: "/salesMenLogin",
		name: "SalesMenLogin",
		component: SalesMenLogin,
	},
	{
		path: "/adminsLogin",
		name: "adminsLogin",
		component: AdminsLogin,
	},
	//管理员系统路由
	{
		path: "/adminsSystem",
		name: "AdminsSystem",
		component: AdminsSystem,
		children: [
			//管理员列表
			{
				path: "adminsList",
				name: "AdminsList",
				component: () => import("../components/admins/AdminsList.vue"),
			},
			//管理员添加
			{
				path: "adminsAdd",
				name: "AdminsAdd",
				component: () => import("../components/admins/AdminsAdd.vue"),
			},
			//管理员修改
			{
				path: "adminsUpdate/:_id",
				name: "AdminsUpdate",
				component: () => import("../components/admins/AdminsUpdate.vue"),
			},
			// 销售员列表
			{
				path: "salesMenList",
				name: "SalesMenList",
				component: () => import("../components/salesMen/SalesMenList.vue"),
			},
			// 销售员新增
			{
				path: "salesMenAdd",
				name: "SalesMenAdd",
				component: () => import("../components/salesMen/SalesMenAdd.vue"),
			},
			// 销售员修改
			{
				path: "salesMenUpdate/:_id",
				name: "SalesMenUpdate",
				component: () => import("../components/salesMen/SalesMenUpdate.vue"),
			},
			//客户列表
			{
				path: "CustomersList",
				name: "CustomersList",
				component: () => import("../components/customers/CustomersList.vue"),
			},
			// duchuandong
			// 订单
			{
				path: "mOrders",
				name: "Morders",
				component: () => import("../components/orders/Morders.vue"),
				children: [
					{
						path: "mOrdersList",
						name: "MordersList",
						component: () => import("../components/orders/MordersList.vue"),
					},
					{
						path: "mOneOrdersDetails",
						name: "MoneOrdersDetails",
						component: () =>
							import("../components/orders/MoneOrdersDetails.vue"),
					},
				],
			},
			{
				path: "mOutOrders",
				name: "MoutOrders",
				component: () => import("../components/orders/MoutOrders.vue"),
			},

			//  保险分类
			{
				path: "classesList",
				name: "ClassesList",
				component: () =>
					import("../components/classes/ClassesList.vue"),
			},

			//保险产品列表 陈维
			{
				path: "productsList",
				name: "productsList",
				component: () => import("../components/products/ProductsList"),
			},
			//新增保险产品
			{
				path: "addProducts",
				name: "addProducts",
				component: () => import("../components/products/AddProducts"),
			},
			//管理页面的理赔管理
			{
				path: "claimsList",
				name: "ClaimsList",
				component: Claims,
			},
			{
				path: "claimsAudio/:_id",
				name: "ClaimsAudio",
				component: () => import("../components/claims/ClaimsAudio.vue"),
			},
		],
	},
	//销售员系统路由
	{
		path: "/salesMenSystem",
		name: "SalesMenSystem",
		component: SalesMenSystem,

		children: [
			{
				path: "salesMenList",
				name: "SalesMenList",
				component: () => import("../components/salesMen/SalesMenList.vue"),
			},
			{
				path: "salesMenAdd",
				name: "SalesMenAdd",
				component: () => import("../components/salesMen/SalesMenAdd.vue"),
			},
			{
				path: "salesMenUpdate/:_id",
				name: "SalesMenUpdate",
				component: () => import("../components/salesMen/SalesMenUpdate.vue"),
			},
			{
				path: "AddCustomers",
				name: "AddCustomers",
				component: () => import("../components/customers/AddCustomers.vue"),
			},
			{
				path: "MyCustomers",
				name: "MyCustomers",
				component: () => import("../components/customers/MyCustomers.vue"),
			},
			//客户修改
			{
				path: "CustomersUpdate/:_id",
				name: "CustomersUpdate",
				props: true,
				component: () => import("../components/customers/CustomerUpdate.vue"),
			},
			//TanLifeng
			{
				path: "claimsAdd",
				name: "ClaimsAdd",
				component: () => import("../components/claims/ClaimsAdd.vue"),
			},
			{
				path: "claimsList",
				name: "ClaimsList",
				component: () =>
					import("../components/claims/ClaimsListSalesMenSystem.vue"),
			},
			// 销售界面 订单
			{
				path: 'xOutOrders',
				name: 'XoutOrders',
				component: () => import('../components/xorders/XoutOrders.vue'),
			},
			// 修改订单
			{
				path: 'xModifyOrders',
				name: 'XmodifyOrders',
				component: () => import('../components/xorders/XmodifyOrders.vue'),
			},
			// 订单
			{
				path: 'xOrders',
				name: 'Xorders',
				component: () => import('../components/xorders/Xorders.vue'),
				children: [
					{
						path: 'xOrdersList',
						name: 'XordersList',
						component: () => import('../components/xorders/XordersList.vue'),
					},
					{
						path: 'xOneOrdersDetails',
						name: 'xOneOrdersDetails',
						component: () => import('../components/xorders/XoneOrdersDetails.vue'),
					},
					{
						path: 'xOutOrdersList',
						name: 'XoutOrdersList',
						component: () => import('../components/xorders/XoutOrdersList.vue'),
					}
				]
			},
		],
	},
];

const router = new VueRouter({
	// mode: 'history',
	base: process.env.BASE_URL,
	routes,
});



export default router;
